package com.hice.demo.springboot.motan.controller;

import com.hice.demo.springboot.motan.model.User;
import com.hice.demo.springboot.motan.service.UserService;
import com.weibo.api.motan.config.springsupport.annotation.MotanReferer;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by hyson on 2017/3/6.
 */
@RestController
public class UserController {
    @MotanReferer
    UserService userService;

    @GetMapping("/say")
    public String say(String txt){
        return userService.say(txt);
    }

    @GetMapping("/add")
    public User add(String name){
        User user = User.builder().name(name).build();
        return user;
    }

}  